// 自定义指令的好处：操作DOM逻辑只要写一次
import defaultImg from '@/assets/common/head.jpg'
import store from '@/store'
export const imgerror = {
  inserted(el) {
    el.onerror = function() {
      this.src = defaultImg
    }
  }
}
export const permission = {
  // 指令 在谁身上，el就是谁
  inserted(el, binding) {
    console.log(binding.value)
    const points = store.state.user.userInfo.roles.points
    if (!points.includes(binding.value)) {
      el.style.display = 'none'
    }
  }
}
